package homework0306;

import java.io.File;
import java.io.FileFilter;

public class ListFilesDemo3 {
    public static void main(String[] args) {
        File dir =new File(".");
        if (dir.isDirectory()){
            File[] subs=dir.listFiles(file->dir.getName().endsWith(".txt"));
            for (File sub:subs){
                System.out.println(sub.getName());
            }
        }
    }
}
